<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016-03-15
 * Time: 10:33
 */
namespace Admin\Controller;

class AdminLogController extends BaseController {

    /**
     * 用户操作日志列表
     */
    public  function index(){
        $this->assign("user_id",I("request.user_id"));
        $userList= M("admin_user")->select();
        $this->assign("userList",$userList);
        $this->display();
    }


    public  function  index_list(){
        $user_id=I("request.id");
        $where=array();
        if(is_numeric($user_id)&&intval($user_id)>0){
            $where["adminlog.user_id"]=$user_id;
        }
        $_where_order_field["alias"]="adminlog";
        $_where_order_field['join']="inner join ".C("DB_PREFIX")."admin_user adminuser on adminlog.user_id=adminuser.user_id ";
        $_where_order_field['where']=$where;
        $_where_order_field['id']='order_list_item_content';
        $_where_order_field['order']='log_time DESC';
        $_where_order_field['field']="adminlog.*,adminuser.user_name";
        $detail=$this->_getListsFromModel("admin_log",$_where_order_field);
        $this->assign("_dataList",$detail);
        $this->display();
    }
}

?>
